package sc.tcp.impl;


import java.io.IOException;
import java.io.InputStream;
import java.net.ServerSocket;
import java.net.Socket;

import org.apache.log4j.Logger;

import sc.helper.Constants;
import sc.tcp.TCPGateway;
import sc.udp.UDPGateway;
import sun.nio.ch.SocketOpts.IP.TCP;


public class TCPGatewayServer extends TCPGatewayImpl {

	private Logger logger = Logger.getLogger(this.getClass());
	
	private ServerSocket serverSocket;
	
	public TCPGatewayServer() {
		logger.info("Starting...");

		try {
			serverSocket = new ServerSocket(Constants.TCP_PORT);
			logger.debug("Socket bound to port: " + Constants.TCP_PORT);
			
			socket = serverSocket.accept();
			logger.info("Client connected: " + socket.getInetAddress());

		} catch (IOException e) {
			e.printStackTrace();
		}
	}

}
